package com.jr.ai.api.domain.ai.model.chat;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.jr.ai.api.domain.ai.common.Constants;
import lombok.Builder;
import lombok.Data;

import java.io.Serializable;

/**
 * author: JiangJiang
 * description 问题信息描述
 * date: 2024/4/7 15:48
 */
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
public class Message implements Serializable {

    private String role;

    private String content;

    private String name;

    public Message() {
    }

    private Message(Builder builder){
        this.role = builder.role;
        this.content = builder.content;
        this.name = builder.name;
    }

    public static Builder builder(){
        return new Builder();
    }

    public static final class Builder {
        private String role;
        private String content;
        private String name;

        public Builder() {
        }

        public Builder role(Constants.Role role) {
            this.role = role.getCode();
            return this;
        }

        public Builder content(String content){
            this.content  = content;
            return this;
        }

        public Builder name(String name){
            this.name = name;
            return this;
        }

        public Message build(){
            return new Message(this);
        }


    }

}
